#ifndef _HX712_H_
#define _HX712_H_

#include <Arduino.h>

class HX712
{
private:
    int hx_dio;
    int hx_sck;
    long offset;
    float stable = 0;
    bool isStable = true;
    float n_1 = 0;
    float smooth = 0.1;
    double gain = 0.485477899589;
public:
    HX712(){};
    void begin(int dio,int sck){
        hx_dio = dio;
        hx_sck = sck;
        pinMode(sck,OUTPUT);
        pinMode(dio,INPUT);

        delay(10);
        offset = readMulti();
    }

    uint32_t read();
    long readMulti(int num = 10);
    int readReal();
    bool state(){return isStable;};
};

#endif